require("../../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pagesA/pages/userA/withdraw" ], {
    4548: function(t, e, a) {
        a.r(e);
        var n, o = a("8056"), i = a("dbb0");
        for (n in i) "default" !== n && function(t) {
            a.d(e, t, function() {
                return i[t];
            });
        }(n);
        a("e3dd");
        var r = a("f0c5"), o = Object(r.a)(i.default, o.b, o.c, !1, null, null, null, !1, o.a, void 0);
        e.default = o.exports;
    },
    "4e2a": function(t, e, a) {
        (function(t) {
            function e(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            a("0cda"), e(a("66fd")), t(e(a("4548")).default);
        }).call(this, a("543d").createPage);
    },
    8056: function(t, e, a) {
        a.d(e, "b", function() {
            return n;
        }), a.d(e, "c", function() {
            return o;
        }), a.d(e, "a", function() {});
        var n = function() {
            this.$createElement;
            this._self._c;
        }, o = [];
    },
    a505: function(t, e, a) {},
    dbb0: function(t, e, a) {
        a.r(e);
        var n, o = a("ecf5"), i = a.n(o);
        for (n in o) "default" !== n && function(t) {
            a.d(e, t, function() {
                return o[t];
            });
        }(n);
        e.default = i.a;
    },
    e3dd: function(t, e, a) {
        var n = a("a505");
        a.n(n).a;
    },
    ecf5: function(e, s, c) {
        (function(n) {
            Object.defineProperty(s, "__esModule", {
                value: !0
            }), s.default = void 0;
            var e, r = (e = c("a34a")) && e.__esModule ? e : {
                default: e
            };
            function u(t, e, a, n, o, i, r) {
                try {
                    var s = t[i](r), u = s.value;
                } catch (t) {
                    return a(t), 0;
                }
                s.done ? e(u) : Promise.resolve(u).then(n, o);
            }
            var l = getApp(), a = {
                data: function() {
                    return {
                        module_name: l.globalData.module_name,
                        showAlert_login: !1,
                        userinfo: n.getStorageSync("userinfo"),
                        setting: n.getStorageSync("setting"),
                        wxCode: "",
                        systemtype: "",
                        num: "",
                        logs: [],
                        page: 1,
                        loadingType: 0,
                        showSkeleton: !0,
                        isLoading: !1,
                        aliPayAccountIsEmpyt: !0,
                        inputVal: "",
                        charge: 0,
                        user: {
                            realname: "✄✄✄✄✄✄",
                            credit: "✄✄",
                            withdraw_to: "✄✄✄✄✄✄",
                            withdraw_min: 0
                        },
                        tabs: [ "提现到微信", "提现到支付宝" ],
                        currIndex: 0,
                        userInfo: {},
                        QRcode: "",
                        showModal: !1
                    };
                },
                props: {},
                onReady: function() {
                    this.$refs.skeleton.init();
                },
                onShow: function() {
                    this.getUserWithdraw();
                },
                onLoad: function(t) {
                    var s, a = this;
                    return s = r.default.mark(function t() {
                        var e;
                        return r.default.wrap(function(t) {
                            for (;;) switch (t.prev = t.next) {
                              case 0:
                                return t.next = 2, a.$onLaunched;

                              case 2:
                                (e = a).setting = n.getStorageSync("setting"), e.tabBar = n.getStorageSync("tabbar"), 
                                e.userinfo = n.getStorageSync("userinfo"), n.hideLoading(), a.module_name = l.globalData.module_name, 
                                a.dataLoad(), n.setNavigationBarTitle({
                                    title: n.getStorageSync("setting").cash_tixian_title
                                });

                              case 12:
                              case "end":
                                return t.stop();
                            }
                        }, t);
                    }), function() {
                        var t = this, r = arguments;
                        return new Promise(function(e, a) {
                            var n = s.apply(t, r);
                            function o(t) {
                                u(n, e, a, o, i, "next", t);
                            }
                            function i(t) {
                                u(n, e, a, o, i, "throw", t);
                            }
                            o(void 0);
                        });
                    }();
                },
                onPullDownRefresh: function() {
                    this.user_info(), this.logs = [], this.page = 1, this.loadingType = 0, this.dataLoad();
                },
                onReachBottom: function() {
                    1 != this.loadingType && 2 != this.loadingType && this.dataLoad();
                },
                watch: {
                    inputVal: function(t, e) {
                        var a, n = this;
                        a && clearTimeout(a), a = setTimeout(function() {
                            n.charge = t ? (parseFloat(t) * parseFloat(n.user.withdraw_tax_proportion) / 100).toFixed(2) : 0;
                        }, 500);
                    }
                },
                methods: {
                    info: function() {
                        n.navigateTo({
                            url: "info"
                        });
                    },
                    tapTab: function(t) {
                        this.currIndex = t;
                    },
                    getUserInfo: function() {
                        var e = this, t = (new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime(), 
                        l.globalData.util.url("entry/wxapp/userinfonew", {
                            m: l.globalData.module_name
                        }));
                        n.request({
                            url: t,
                            method: "GET",
                            data: {
                                openid: n.getStorageSync("openid")
                            },
                            success: function(t) {
                                t = t.data.data;
                                e.userinfo = t, e.showSkeleton = !1, e.aliPayAccountIsEmpyt = !(e.user.realname && e.user.alipayno);
                            }
                        });
                    },
                    aliAccount: function(a) {
                        var n = this;
                        return o(i.default.mark(function e() {
                            return i.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    2 == t.getStorageSync(n.ENUM.STORAGE_BIND_INFO).need_mobile ? t.navigateTo({
                                        url: "/pages/auth/index?type=1"
                                    }) : t.navigateTo({
                                        url: "./addAliPay?type=" + a + "&realname=" + n.user.realname + "&withdraw_to=" + n.user.withdraw_to
                                    });

                                  case 2:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    fillInput: function() {
                        this.inputVal = this.user.credit;
                    },
                    save: function() {
                        var n = this, a = this;
                        0 != parseFloat(this.user.credit) ? "" != this.inputVal.trim() ? parseFloat(this.inputVal.trim()) < parseFloat(this.user.withdraw_min) ? t.showToast({
                            icon: "none",
                            title: "提现金额不能小于" + this.user.withdraw_min
                        }) : parseFloat(this.inputVal.trim()) > parseFloat(this.user.credit) ? t.showToast({
                            icon: "none",
                            title: "提现金额不能大于" + this.user.credit
                        }) : parseInt(100 * this.inputVal.trim()) % parseInt(100 * this.user.withdraw_bei) ? t.showToast({
                            icon: "none",
                            title: "提现金额必须是".concat(this.user.withdraw_bei, "的倍数")
                        }) : (this.isLoading = !0, this.$api.withdraw({
                            money: this.inputVal,
                            withdraw_type: this.currIndex ? 0 : 1
                        }, !1).then(function(e) {
                            n.$common.subscribeMessage("withdraw"), n.isLoading = !1, t.showModal({
                                title: "申请提示",
                                content: "提现申请提交成功，如有疑问请联系客服",
                                showCancel: !1,
                                success: function(t) {
                                    t.confirm && (a.$refs.skeleton.init(), a.inputVal = "", a.getUserWithdraw());
                                }
                            });
                        }).catch(function(e) {
                            if (console.log("err: ", e), n.isLoading = !1, e.data.withdraw_first_kf_text && e.data.withdraw_first_kf_image) {
                                t.hideToast();
                                var a = e.data.withdraw_first_kf_text;
                                return n.QRcode = e.data.withdraw_first_kf_image, void t.showModal({
                                    title: "温馨提示",
                                    content: a,
                                    success: function(t) {
                                        t.confirm && (n.showModal = !0);
                                    }
                                });
                            }
                            1 == e.data.need_subscribe && (t.hideToast(), t.navigateTo({
                                url: "/pages/auth/index?type=5"
                            }));
                        })) : t.showToast({
                            icon: "none",
                            title: "请输入提现金额"
                        }) : t.showToast({
                            icon: "none",
                            title: "当前账户余额为0"
                        });
                    },
                    user_info: function() {
                        var e = this, t = l.globalData.util.url("entry/wxapp/userinfonew", {
                            m: l.globalData.module_name
                        });
                        n.request({
                            url: t,
                            method: "POST",
                            header: {
                                "content-type": "application/x-www-form-urlencoded"
                            },
                            data: {
                                openid: n.getStorageSync("openid")
                            },
                            success: function(t) {
                                n.setStorageSync("userinfo", t.data.data), e.userinfo = t.data.data, n.stopPullDownRefresh();
                            }
                        });
                    },
                    dataLoad: function() {
                        var e = this, t = l.globalData.util.url("entry/wxapp/api", {
                            m: l.globalData.module_name,
                            o: "cashlog"
                        });
                        this.loadingType = 1, n.request({
                            url: t,
                            method: "POST",
                            header: {
                                "content-type": "application/x-www-form-urlencoded"
                            },
                            data: {
                                openid: n.getStorageSync("openid"),
                                page: this.page
                            },
                            success: function(t) {
                                1 == t.data.status && (t = l.globalData.crypt.Decrypt(t.data.data.data, t.data.data.key), 
                                t = JSON.parse(t), console.log(t), e.logs = e.logs.concat(t.logs), e.logs = e.logs, 
                                e.page > t.total ? 0 == e.logs.length ? e.loadingType = 4 : e.loadingType = 2 : e.page == t.total ? e.loadingType = 2 : (e.page = e.page + 1, 
                                e.loadingType = 0, e.page = e.page));
                            }
                        });
                    },
                    numChange: function(t) {
                        this.num = t.target.value;
                    },
                    clearInput: function() {
                        this.num = "";
                    },
                    formSubmit: function(t) {
                        var e = t.detail.value, t = l.globalData.util.url("entry/wxapp/api", {
                            m: l.globalData.module_name,
                            o: "cash"
                        });
                        "" != e.num && 0 != e.num ? n.request({
                            url: t,
                            method: "POST",
                            header: {
                                "content-type": "application/x-www-form-urlencoded"
                            },
                            data: {
                                openid: n.getStorageSync("openid"),
                                num: e.num
                            },
                            success: function(t) {
                                1 == t.data.status ? n.showToast({
                                    title: t.data.msg
                                }) : n.showToast({
                                    title: t.data.msg,
                                    icon: "none"
                                });
                            }
                        }) : n.showToast({
                            title: n.getStorageSync("setting").cash_tixian_qtxtxje,
                            icon: "none"
                        });
                    }
                }
            };
            s.default = a;
        }).call(this, c("543d").default);
    }
}, [ [ "4e2a", "common/runtime", "common/vendor" ] ] ]);